<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'test.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script src="js/jquery-1.9.0.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css"
	href="admin/val/jquery.validate.css" />
<script src="admin/val/jquery.validate.js" type="text/javascript">
</script>
<script type="text/javascript">
            /* <![CDATA[ */
            jQuery(function(){
                jQuery("#ValidNumber").validate({
                    expression: "if (!isNaN(VAL) && VAL) return true; else return false;",
                    message: "Should be a number"
                });
                jQuery("#Email").validate({
                    expression: "if (VAL.match(/^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$/)) return true; else return false;",
                    message: "Should be a valid Email id"
                });
                jQuery("#ValidNumber").validate({
                    expression: "if (VAL > 100) return true; else return false;",
                    message: "Should be greater than 100"
                });
                jQuery("#Mobile").validate({
                    expression: "if (VAL.match(/^[9][0-9]{9}$/)) return true; else return false;",
                    message: "Should be a valid Mobile Number"
                });
            });
            /* ]]> */
        </script>
</head>

<body>
	<div class="TabBody">
	<a href="admin/user!addUser">dd</a>
            <h1>jQuery Live Form Validation Demo</h1>
            <form action="" method="post">
                <table cellpadding="3" cellspacing="2">
                    <tr>
                        <td>
                            Enter a valid number greater than 100
                        </td>
                        <td>
                            <input type="text" name="ValidNumber" id="ValidNumber" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Enter a valid Email
                        </td>
                        <td>
                            <input type="text" name="Email" id="Email" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Enter a valid Mobile Number 
                            <small>
                                (Eg: 9854398543)
                            </small>
                        </td>
                        <td>
                            <input type="text" name="Mobile" id="Mobile" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <input type="submit" value="Submit" style="background: #EFEFEF;"/>
                        </td>
                    </tr>
                </table>
            </form>
            <a href="admin/news!detail?id=1">d</a>
        </div>
       <!--  <script type="text/javascript">
            /* <![CDATA[ */
            var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
            document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
            /* ]]> */
        </script>
        <script type="text/javascript">
            /* <![CDATA[ */
            try {
                var pageTracker = _gat._getTracker("UA-10628239-1");
                pageTracker._trackPageview();
            } 
            catch (err) {
            }
            /* ]]> */
        </script> -->
</body>
</html>
